<?php /*a:5:{s:63:"E:\code\jiaoyou\application\admin\view\member\update_token.html";i:1599110057;s:57:"E:\code\jiaoyou\application\admin\view\public\header.html";i:1598939754;s:54:"E:\code\jiaoyou\application\admin\view\public\css.html";i:1598939754;s:53:"E:\code\jiaoyou\application\admin\view\public\js.html";i:1598939754;s:57:"E:\code\jiaoyou\application\admin\view\public\footer.html";i:1598939753;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<title>后台系统</title>
<!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="http://jiaoyou.com\/style/admin/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="http://jiaoyou.com\/style/admin/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="http://jiaoyou.com\/style/admin/css/animate.min.css" />
<link rel="stylesheet" type="text/css" href="http://jiaoyou.com\/style/admin/css/style.min.css" />
<link rel="stylesheet" type="text/css" href="http://jiaoyou.com\/style/admin/css/ffxiang.css" />
<link rel="shortcut icon" href="http://jiaoyou.com\/style/admin/img/favicon.ico">
    <script type="text/javascript" src="http://jiaoyou.com\/style/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="http://jiaoyou.com\/style/admin/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="http://jiaoyou.com\/style/layui/layui.js"></script>
    <link rel="stylesheet" type="text/css" href="http://jiaoyou.com\/style/layui/css/layui.css" />
</head>
<style type="text/css">.gray-bg {
    background: #fff;
}

.wrapper {
    padding: 0px;
}

.layui-form-checkbox i {
    height: 30px !important;
}</style>
<body class="gray-bg" id="body">
<div class="wrapper wrapper-content">
    <div class="row">
        <form class="form-horizontal" method="post">
            <div class="col-sm-12">
                <div class="ibox-content">


                    <div class="form-group ">
                        <label class="col-sm-2 control-label">用户id：</label>
                        <div class="col-sm-4">
                            <input type="text" name="begin_id" class="layui-input" id="begin_id" value=""
                                   onKeyUp="this.value=this.value.replace(/[^\.\d]/g,'');this.value=this.value.replace('.','');"
                                   placeholder="开启用户id">
                        </div>
                        <div class="col-sm-4">
                            <input type="text" name="end_id" class="layui-input" id="end_id" value=""
                                   onKeyUp="this.value=this.value.replace(/[^\.\d]/g,'');this.value=this.value.replace('.','');"
                                   placeholder="结束用户id">
                        </div>
                        <div class="col-sm-1">
                            &nbsp;
                        </div>
                    </div>
                    <div class="form-group ">
                        <label class="col-sm-2 control-label"></label>
                        <div class="layui-progress layui-progress-big col-sm-9" lay-showpercent="true"
                             lay-filter="demo">
                            <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
                        </div>
                        <div class="col-sm-1">
                            &nbsp;
                        </div>
                    </div>
                    <div class="form-group  ">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-9">
                            <p class="layui-btn site-demo-active" data-type="loading">模拟loading</p>
                            <!--<a  class="btn btn-w-m btn-primary" style="display: block; width: 120px;margin-left: 0;" ><i class="fa fa-check"></i> &nbsp;g</a>-->
                        </div>
                    </div>

                </div>
            </div>
            <input type="hidden" name="id" value="<?php echo htmlentities((isset($name['id']) && ($name['id'] !== '')?$name['id']:0)); ?>"/>
            <input name="longitude" id="longitude" type="hidden" class="form-control"
                   value="<?php echo htmlentities((isset($name['longitude']) && ($name['longitude'] !== '')?$name['longitude']:'')); ?>"/>
            <input name="latitude" id="latitude" type="hidden" class="form-control"
                   value="<?php echo htmlentities((isset($name['latitude']) && ($name['latitude'] !== '')?$name['latitude']:'')); ?>"/>
        </form>
    </div>
</div>
     
    <script type="text/javascript" src="http://jiaoyou.com\/style/admin/js/content.min.js"></script>
    <link rel="stylesheet" type="text/css" href="http://jiaoyou.com\/style/admin/plugins/sweetalert/sweetalert.css" />
    <script type="text/javascript" src="http://jiaoyou.com\/style/admin/plugins/sweetalert/sweetalert.min.js"></script>
    <script type="text/javascript" src="http://jiaoyou.com\/style/admin/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="http://jiaoyou.com\/style/admin/js/ffxiangIndex.js"></script>
    <script type="text/javascript" src="http://jiaoyou.com\/style/admin/js/common.js"></script>
</body>
</html>
<script type="text/javascript" src="http://jiaoyou.com\/style/admin/js/area.js?ver=20200522"></script>
<script type="text/javascript" src="http://jiaoyou.com\/style/admin/plugins/iCheck/icheck.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://jiaoyou.com\/style/admin/plugins/iCheck/custom.css" />
<script>

    layui.use('element', function () {
        var $ = layui.jquery
            , element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
        $('.site-demo-active').on('click', function () {
            var begin_id = parseInt($("#begin_id").val());
            var end_id = parseInt($("#end_id").val());
            if (begin_id > end_id) {
                layer.msg("开启id不能大于结束id", {icon: 5, time: 2000});
                return;
            }
            var othis = $(this);
            var DISABLED = 'layui-btn-disabled';
            if (othis.hasClass(DISABLED)) return;
            //模拟loading
            var total = end_id - begin_id + 1;
            var diff = 100 / total;

            var i = 0, timer = setInterval(function () {
                i += diff;
                if (i > 100) {
                    element.progress('demo', '100%');
                    othis.addClass(DISABLED);
                    clearInterval(timer);
                    othis.removeClass(DISABLED);
                    return;
                }
                if (begin_id <= end_id) {
                    $.post("<?php echo url('Member/updateToken'); ?>", {id: begin_id},
                        function (data) {
                            begin_id++;
                            element.progress('demo', getFloat(i, 1) + '%');
                            othis.addClass(DISABLED);
                        });
                }

            }, Math.ceil(Math.random() * 1000) + 1300);
        });
    });


    function getFloat(num, n) {
        n = n ? parseInt(n) : 0;
        if (n <= 0) {
            return Math.round(num);
        }
        num = Math.round(num * Math.pow(10, n)) / Math.pow(10, n); //四舍五入
        num = Number(num).toFixed(n); //补足位数
        return num;
    };
</script>
